package com.xyj.week05;

import com.xyj.common.TreeNodeWithNext;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class T3 {
    public static void main(String[] args) {
        //对象集合列表
        List<Object> arr=new ArrayList<>();
        //返回给前端的列表
        List<Object> ret=new ArrayList<>();

        //想要放在面的省份列表
        List<Object> objectList = arr
                .stream()
                .filter(x -> x.equals("想要的省份"))
                .collect(Collectors.toList());
        //将这些的省份移除
        arr.removeAll(objectList);

        //组装给前端
        ret.addAll(objectList);
        ret.add(arr);
    }
    public void connectOneSide(TreeNodeWithNext node1, TreeNodeWithNext node2){
        if(node1==null||node2==null) {
            return;
        }
        //node1指向node2
        node1.next=node2;
        // 左边树
        connectOneSide(node1.left,node1.right);
        connectOneSide(node2.left,node2.right);
        connectOneSide(node1.right,node1.left);
    }
}
